package com.chenyongjing.design.pattern.observer.mouseevent;

import com.chenyongjing.design.pattern.observer.mouseevent.core.EventListener;
import com.chenyongjing.design.pattern.observer.mouseevent.handler.Mouse;
import com.chenyongjing.design.pattern.observer.mouseevent.handler.MouseEventListenter;
import com.chenyongjing.design.pattern.observer.mouseevent.handler.MouseEventType;

/**
 * @Author chen
 * @Date 2022/12/6 22:25
 */
public class Test {
    public static void main(String[] args) {
        EventListener listener = new MouseEventListenter();
        Mouse mouse = new Mouse();
        mouse.addListener(MouseEventType.ON_CLICK,listener);
        mouse.addListener(MouseEventType.ON_MOVE,listener);

        mouse.click();
        mouse.move();
    }
}
